Import mojo
Import diddy
Import model
Import linkButton

Class IntroScreen Extends Screen

	Field linkButtonsList:ArrayList<LinkButton> = New ArrayList<LinkButton>
	
	Method New()
		name = "IntroScreen"
		Local button1:LinkButton = LinkButton.Create(game.images.Find("collectStar"),"SEQUENCE GAME", SCREEN_WIDTH2+10, SCREEN_HEIGHT2-50,New SequenceGameLink(),0,  0, linkButtonsList)
		Local button2:LinkButton = LinkButton.Create(game.images.Find("collectStar"),"ODD EVEN GAME", SCREEN_WIDTH2+10, SCREEN_HEIGHT2,New OddEvenLink(),0,  1, linkButtonsList)
		Local button3:LinkButton = LinkButton.Create(game.images.Find("collectStar"),"MATHS SHOOT GAME", SCREEN_WIDTH2+10, SCREEN_HEIGHT2+50,New MathsShootLink(),0, 2, linkButtonsList)
		Local button4:LinkButton = LinkButton.Create(game.images.Find("collectStar"),"COUNTING GAME", SCREEN_WIDTH2+10, SCREEN_HEIGHT2+100,New CountingLink(),0,  3, linkButtonsList)
		Local button5:LinkButton = LinkButton.Create(game.images.Find("collectStar"),"< BACK", SCREEN_WIDTH2+10, SCREEN_HEIGHT2+150,New BackMainLink(),0,  4, linkButtonsList)

	End
	
	Method Start:Void()
		LinkButton.StartAll(linkButtonsList)
	End
	
	Method Render:Void()
		Cls
		DrawText("CHOOSE GAME:", 5, SCREEN_HEIGHT2,0,0.5)

		LinkButton.DrawAll(linkButtonsList)
	End
	
	Method Update:Void()
	LinkButton.UpdateAll(linkButtonsList)

	End
End

Class BackMainLink Extends ButtonEvent

	Method OnClicked:Void()
		game.nextScreen = _model._mainMenuScreen
		game.screenFade.Start(50, true)
	End
End

Class SequenceGameLink Extends ButtonEvent

	Method OnClicked:Void()
		_model.gameMode = Model.GAME_MODE_BONUS_SEQUENCE
		game.nextScreen = _model._setDifficultyScreen
		game.screenFade.Start(50, true)
	End
End

Class OddEvenLink Extends ButtonEvent
	
	Method OnClicked:Void()
		_model.gameMode = Model.GAME_MODE_BONUS_ODD_EVEN
		game.nextScreen = _model._setDifficultyScreen
		game.screenFade.Start(50, true)
	End
End

Class MathsShootLink Extends ButtonEvent

	Method OnClicked:Void()
		_model.gameMode = Model.GAME_MODE_BONUS_SHOOT
		game.nextScreen = _model._setDifficultyScreen
		game.screenFade.Start(50, true)
	End
End

Class CountingLink Extends ButtonEvent

	Method OnClicked:Void()
		_model.gameMode = Model.GAME_MODE_BONUS_COUNTING
		game.nextScreen = _model._setDifficultyScreen
		game.screenFade.Start(50, true)
	End
End
